package com.sporch.controller;

import com.sporch.model.EndpointRegistration;
import com.sporch.service.EndpointRegistrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author: czy
 * @Date: 2019/6/5 9:12
 */
@Controller
@RequestMapping("/endpointRegistration")
public class EndpointRegistrationController {

    @Autowired
    EndpointRegistrationService endpointRegistrationService;

    @RequestMapping("/findAll")
    public String findAll(Model model){
        List<EndpointRegistration> all = endpointRegistrationService.findAll();
        model.addAttribute("aa","端点注册信息");
        model.addAttribute("all",all);
        return "index.html";
    }
}
